package com.lagou.demo.controller;

import com.lagou.demo.service.IDemoService;
import com.lagou.edu.mvcframework.annotation.LgAutowired;
import com.lagou.edu.mvcframework.annotation.LgController;
import com.lagou.edu.mvcframework.annotation.LgRequestMapping;
import com.lagou.edu.mvcframework.annotation.LgSecurity;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @Author Lidong Gao
 * @Description
 * @Date 2021/4/30
 **/
@LgController
@LgRequestMapping("/demo")
public class DemoController {
    @LgAutowired
    private IDemoService demoService;

    @LgRequestMapping("/get")
    public String get(HttpServletRequest req, HttpServletResponse resp, String name) {
        return demoService.get(name);
    }

    @LgRequestMapping("/security")
    @LgSecurity({"zhangsan", "lisi"})
    public String security(String username) {
        return demoService.get(username);
    }
}
